﻿@using Board.Models
@{
    ViewBag.Title = "Kardex";
}

@section styles
{
    <style>
        .content-wrapper{
            max-width: inherit;
        }
    </style>
}

<h2>Electronic Kardex</h2>
<table>
    <thead>
        <tr>
            <th>Bed</th>
            <th>Patient<br/>Name</th>
            <th>Feeding</th>
            <th>Delivery<br/>Time</th>
            <th>PPD</th>
            <th>Delivery<br/>Type</th>
            <th>G/P</th>
            <th>Social<br/>Work</th>
            <th>DC</th>
            <th>Gestation</th>
            <th>Current<br/>Weight</th>
            <th>%Weight<br/>Loss</th>
            <th>LC</th>
            <th>Baby<br/>Location</th>
            <th>Physician</th>
            <th>Pediatrician</th>
            <th>RN</th>
            <th>View<br/>Modify</th>
        </tr>
    </thead>
    <tbody>
        @if (ViewBag.Mom != null && ((List<v_KardexMom>)ViewBag.Mom).Any())
        {
            List<v_KardexMom> moms = ViewBag.Mom;
            foreach (var mom in moms)
            {
                <text>
                    <tr>
                        <td>@mom.UnitID - @mom.Bed</td>
                        <td>@mom.MomFirstName<br />@mom.MomLastName</td>
                        <td>@mom.Feeding</td>
                        <td>@(mom.DeliveryDate.HasValue?mom.DeliveryDate.Value.ToString("f"):"")</td>
                        <td>@mom.DeliveryPPD</td>
                        <td>@mom.DeliveryOther</td>
                        <td>@mom.DeliveryGP</td>
                        <td>@mom.MomSocialWork</td>
                        <td>@mom.MomDischargeType</td>
                        <td>@mom.BabyGestAge</td>
                        <td>@mom.WeightCurrent</td>
                        <td>@(mom.WeightCurrent.HasValue && mom.WeightAtBirth.HasValue?String.Format("{0:F}",(((mom.WeightCurrent - mom.WeightAtBirth)*100.0)/(mom.WeightAtBirth*1.0))):"")</td>
                        <td>@mom.LC</td>
                        <td>@mom.Location</td>
                        <td>@mom.MomCurPhys</td>
                        <td>@mom.BabyPediatrician</td>
                        <td>@mom.MomRN</td>
                        <td>@Html.ActionLink("Modify", "Modify", new {patientId=mom.MomBoardID}, null)</td>
                    </tr>
                </text>
            }
        }
    </tbody>
</table>
